﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LyyCommon;

namespace TestNugetStand
{
    using TestNugetStand.Models;
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("this is net4.6");
            var rst = LyyCommon.Utils.SetFirstToUpper("this is my name");
            Console.WriteLine(rst);

            Person person = new Person()
            {
                Id = 2,
                Name = "张三的",
                Age = 29
            };
            var json = LyyCommon.Helper.JsonHelper.ObjectToJSON(person);
            Console.WriteLine(json);

            var p = LyyCommon.Helper.JsonHelper.JSONToObject<Person>(json);
            Console.WriteLine(p.Name);

            try
            {
                var s = "{}";
                Console.WriteLine(LyyCommon.Helper.JsonHelper.JSONToObject<Person>(s));

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            Console.ReadLine();
        }
    }
}
